<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <base href="http://127.0.0.1:4000/" />
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>打包整站</title>
  <meta name="keywords" content="打包" />
  <meta name="description" content="打包" />
  <link rel="stylesheet" href="static/pages/article_details/index.css?v=1.0.0.2022.08.13 10:12:50">
</head>

<body class="daytime-theme">

  <div class="components_header-wrap">
  <div id="components_header-fix">
    <div class="header clearfix">
      <a class="logo fl" href="/">EOWAY.CN</a>

      <div class="menu-toggle-button fr">导航</div>
      <div class="menu-wrap fr">
        <a class="menu-item" href="/">首页</a>
        <a class="menu-item" href="/about.html">关于</a>
        <div class="menu-item switch-theme-wrap">
          <span>切换主题</span>
          <div id="theme-list">
            <div class="theme-list-item" theme="daytime-theme" >日间</div>
            <div class="theme-list-item" theme="night-theme">夜间</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

  <div class="page-container">
    
<div class="layout-container clearfix">
  <div class="main-wrap">
    <div class="head-wrap">
      <h1 class="title">打包整站</h1>
      <p class="date">2021-08-17 17:46:29</p>
    </div>
    <div class="markdown-body"><h1 id="item-1">自定义打包配置</h1>
<p>配置文件：<code>config\index.js</code>。</p>
<h2 id="item-2">开发预览时</h2>
<p>如果在本地预览，domainName 设置为，如：<code>http://127.0.0.1:4000</code>。</p>
<h2 id="item-3">上线发布时</h2>
<p>如果博客的访问域名是一级域名，domainName 设置为，如：<code>http://example.com</code>。</p>
<p>如果是二级域名，则，如：<code>http://example.com/demo</code>。</p>
<h1 id="item-4">打包静态网站</h1>
<p>打包后的网站静态文件在根目录的<code>dist</code>目录下。</p>
<pre><code class="language-bash">npm run build
</code></pre>
<p>把<code>dist</code>下所有文件复制到服务器。</p>
<h1 id="item-5">热更新打包（开发预览）</h1>
<p>热更新打包，一般用于编辑文章保存后，实时刷新浏览器，预览文章。</p>
<pre><code class="language-bash">npm run dev
</code></pre>
<blockquote>
<p>默认地址：http://127.0.0.1:4000</p>
</blockquote>
</div>
  </div>

  <div class="sliber-wrap">
    
<div class="toc-wrap">
  <div class="title">文章目录</div>
  
  <a class="toc-item line-clamp-multi-1 " anchor="item-1" href="1629193589645.html#item-1">自定义打包配置</a>
  
  <a class="toc-item line-clamp-multi-1 toc-item-child" anchor="item-2" href="1629193589645.html#item-2">开发预览时</a>
  
  <a class="toc-item line-clamp-multi-1 toc-item-child" anchor="item-3" href="1629193589645.html#item-3">上线发布时</a>
  
  <a class="toc-item line-clamp-multi-1 " anchor="item-4" href="1629193589645.html#item-4">打包静态网站</a>
  
  <a class="toc-item line-clamp-multi-1 " anchor="item-5" href="1629193589645.html#item-5">热更新打包（开发预览）</a>
  
</div>



  </div>
</div>

  </div>

  <script src="static/pages/article_details/index.js?v=1.0.0.2022.08.13 10:12:50"></script>

  <script src="static/components/socket/index.js"></script>

</body>

</html>